<template>
<div>
  <el-header><div><i class="el-icon-user"></i><span>个人中心</span></div>  <el-button type="info" @click="getInfo">刷新</el-button></el-header>
  <el-table :data="userInfo" style='width:100%'>
    <el-table-column prop='property' label='属性' width='280'></el-table-column>
    <el-table-column prop='val' label='值' width=''></el-table-column>
  </el-table>
</div>
</template>
<script>
export default {
  data() {
    return {
      userInfo: [
        {
          property: '用户名',
          val: '000'
        },
        {
          property: '邮箱',
          val: '000'
        },
        {
          property: '机构',
          val: '000'
        },
        {
          property: '注册时间',
          val: '000'
        },
        {
          property: '公钥',
          val: '000'
        }
      ]
    };
  },
  mounted:function(){
    this.getInfo()
  },
  methods: {
    getInfo() {
      this.$axios.post('home').then(res => {
        // console.log(res.data.content)
        this.userInfo[0].val = res.data.content.username
        this.userInfo[1].val = res.data.content.mail
        this.userInfo[2].val = res.data.content.institution
        this.userInfo[3].val = res.data.content.date
        this.userInfo[4].val = res.data.content.pubkey
      });
    }
  }
};
</script>
<style lang='less' scoped>
// .el-table{
  
// }
.el-header {
  background-color: #6d7981;
  display: flex;
  justify-content: space-between;
  color: #ffffff;
  font-size: 20px;
  align-items: center;
}
</style>
